function newFrame = addOverlayText(frame, estimatedNumberOfPeople)
    [H, W] = size(frame);
    
    % Calculates the white pixels
    whitePx = nnz(frame);
    blackPx = (H * W) - whitePx;
    
    % Adds the overlay text
    textColor = [255, 255, 255];
    textLocation1 = [10, 10];
    textLocation2 = [10, 40];

    textRow1 = strcat('w: ', num2str(whitePx), ' b: ', num2str(blackPx), ' t: ', num2str(H * W));
    textRow2 = strcat('# ', num2str(estimatedNumberOfPeople));

    txtInserter = vision.TextInserter(textRow1, 'Color', textColor, 'FontSize', 18, 'Location', textLocation1);
    newFrame = step(txtInserter, frame);

    txtInserter = vision.TextInserter(textRow2, 'Color', textColor, 'FontSize', 18, 'Location', textLocation2);
    newFrame = step(txtInserter, newFrame);
end

